package com.dongdongshop.controller;

import com.dongdongshop.data.Result;
import com.dongdongshop.pojo.TbItemCat;
import com.dongdongshop.service.ItemCatService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("itemCat1")
public class ItemCatController {

    @DubboReference
    private ItemCatService itemCatService;

    @RequestMapping("selectById")
    @ResponseBody
    public Result selectById(Long id){
        List<TbItemCat> tbItemCat = itemCatService.selectByPid(id);
        return Result.ok().setData(tbItemCat);
    }

    @RequestMapping("selectId")
    @ResponseBody
    public Result selectId(Long id){
        TbItemCat tbItemCat = itemCatService.selectById(id);
        return Result.ok().setData(tbItemCat);
    }


}
